<?php
// $filepath like this "__FILE__/publicforum/content/help/1/187396.shtml"
function cache($filepath, $filecontent)
{
	$dir = dirname($filepath);
	if(!is_dir($dir))
	{
		umask(0);
		$result = mkdir($dir, 0777, true);
		if(!$result)
			return false;
	}
	file_put_contents($filepath, $filecontent);
	return true;
}

//cache('/home/lamengao/public_html/xtianya/aaa/bbb/ccc/ddd.txt', 'whahahyiyayiyayo~~~');
?>
